<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="css/common.css" type="text/css">
</head>
<body>
    <div id="app">
        
         <img v-bind:src="imgUrl">
        
        <a v-bind:href="Url">百度一下</a>
        <div :class="clsProp">
            <font class="color">tttttttttttttttttttttt</font>
            <h1>张杰</h1> -->
             <p v-if="age===18">我十八岁</p>
            <p v-else-if="age===58">我不再当年</p>
            <p v-else>你还是从前那个少年</p>
            <template v-if="age===18">
                <p>你很好</p>
            </template>
            <template v-else-if="age===58">
                <p>我不配</p>
            </template>
            <template v-else">
                <p>忘了我吧，下一位</p>
            </template> 

            <ul>
                <li v-for="f in friuts">{{f.name}}--{{f.price}}</li>
            </ul>
        </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue">
    </script>
    <script>
        var app=new Vue({
            el:'#app',
            data:{
                msg:"信息",
                age:18,
                
                imgUrl:"./timg.jpg",
                Url:"http://baidu.com",
                hasColor:true,
                hasNum:false,
                bgcolorCls:this.hasColor?'bgcolor':'',
                colorCls:'forecolor',
                friuts:[
                    
                ]
            },
            computed:{
                newMsg:function(){
                    return this.msg
                },
                bgcolorCls:function(){
                  return  this.hasColor?'bgcolor':''
                },
                clsProp:function(){
                    return {
                        bgcolor:this.hasColor,
                        forecolor:this.hasNum
                    };
                }
            },
            filters:{
                formatString:function(val){
                    return val+"仰望星空";
                }
            },
            methods:{
                handleClick:function(){
                    console.log("作品");
                },
                otherMsg:function(){
                    return this.msg+"万物皆可奥里给";
                }
            }
        })
    </script>
</body>
</html>